]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
PopupMenuManager: don't throw exceptions if don't have focus
authorGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 22 Feb 2011 19:56:23 +0000 (20:56 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 2 Mar 2011 15:30:38 +0000 (16:30 +0100)
stage.key_focus can be null, but passing null to _activeMenuContains
throws (from gjs marshalling). In that case, just assume it returned
false.

https://bugzilla.gnome.org/show_bug.cgi?id=642976

js/ui/popupMenu.js

index 0a26ba71e3afe18007f4035a5f35f2a909a30db8..99199224c13225db50bccb77b456824550f19cd4 100644 (file)
@@ -1252,7 +1252,7 @@ PopupMenuManager.prototype = {
                 menu.sourceActor.grab_key_focus();
         } else if (menu == this._activeMenu) {
             let focus = global.stage.key_focus;
-            let fromActive = this._activeMenuContains(focus);
+            let fromActive = focus && this._activeMenuContains(focus);
 
             if (this.grabbed)
                 this._ungrab();